# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-pystemmer
pkgver=2.2.0.1
pkgrel=2
pkgdesc="Snowball stemming algorithms, for information retrieval"
arch=('loong64' 'x86_64')
license=('BSD' 'MIT')
url="http://snowball.tartarus.org"
depends=('python' 'libstemmer')
makedepends=('cython' 'python-setuptools')
source=("https://pypi.io/packages/source/P/PyStemmer/PyStemmer-$pkgver.tar.gz")
sha512sums=('6692381f57c8822d252fac3ae48102b03f63cfa6aba9e963204bc4755217d4697d533ed058d1c6f7155982a3c7d81e82d83578f00fbff3bb94cbb5e1bcc26fc8')

export PYSTEMMER_SYSTEM_LIBSTEMMER=1

build() {
  cd PyStemmer-$pkgver
  python setup.py build
}

check() {
  cd PyStemmer-$pkgver
  PYTHONPATH="$PWD/build/lib.linux-$CARCH-cpython-311" python runtests.py
}

package() {
  cd PyStemmer-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
